Google Chromeのfetch()のタイムアウトの時間
#Google_Chrome
検証コード
Piping ServerでGETでずっと待機させて、どれだけ待機するのかを検証
code:js
(async () => {
const start = new Date();
try {
const res = await fetch("https://ppng.io/mypath");
} catch(err) {
console.error(err);
}
const end = new Date();
console.log(${(end - start) / 1000} sec)
})()
Nipp
結果
120.165 sec
何回かやってみて、いつも120.xx secだった。
だいたい2分ぐらいに設定されているよう。
fetch()のタイムアウトは設定できないので、Chromeのソースコード内で設定されている値のだと思われる。
It doesn't have a specified default; the specification doesn't discuss timeouts at all.
(from: https://stackoverflow.com/a/46946573/2885946)